<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<include file="public:meta" />
	<link href="../public/css/personal/common.css" rel="stylesheet" type="text/css" />
	<link href="../public/css/personal/personal_user.css" rel="stylesheet" type="text/css" />
	<link href="../public/css/personal/personal_ajax_dialog.css" rel="stylesheet" type="text/css" />
	<script src="../public/js/personal/jquery.common.js" type="text/javascript" language="javascript"></script>
</head>
<body>
<include file="public:header_other" />
<div class="us-top">
    <div class="us-main">
        <div class="us-top-box">
            <form id="ajax_search_location" action="{:U('ajaxCommon/ajax_search_location',array('type'=>'QS_jobslist'))}" method="get">
                <div class="input-box"><input type="text" name="key" data-original="请输入关键字" value="" placeholder="请输入关键字" autocomplete="off"></div>
                <div class="se-btn"><input type="submit" value="搜 索"></div>
                <div class="clear"></div>
            </form>
        </div>
    </div>
</div>
	<div class="user_main">
		<include file="index_left_nav" />
  		<div class="mainbox">
			<!--切换卡 -->
			<div class="tab">
				<a class="li select" >消息提醒</a>
				<a class="li J_hoverbut " href="{:U('personal/msg_feedback')}" >咨询反馈</a>
			  	<div class="clear"></div>
			</div>
			<!--切换卡结束 -->
			<div class="pms_th">
		    	<div class="th1">消息内容</div>
				<div class="th2">
					<div class="th_select input_140_30_div J_hoverinput J_dropdown J_listitme_parent">
	                    <span class="J_listitme_text"><if condition="$Think.get.settr gt 0">{$Think.get.settr}天内<else/>发送时间</if></span>
	                    <div class="dropdowbox13 J_dropdown_menu">
	                        <div class="dropdow_inner13">
	                            <ul class="nav_box">
	                                <li><a class="J_listitme" href="{:P(array('settr'=>0))}">全部</a></li>
	                                <li><a class="J_listitme" href="{:P(array('settr'=>3))}">3天内</a></li>
	                                <li><a class="J_listitme" href="{:P(array('settr'=>7))}">7天内</a></li>
	                                <li><a class="J_listitme" href="{:P(array('settr'=>15))}">15天内</a></li>
	                            </ul>
	                        </div>
	                    </div>
	                </div>
				</div>
				<div class="th3">
				  <div class="th_select input_140_30_div J_hoverinput J_dropdown J_listitme_parent">
	                    <span class="J_listitme_text"><if condition="$Think.get.new eq 1">未查看<elseif condition="$Think.get.new eq 2"/>已查看<else/>查看状态</if></span>
	                    <div class="dropdowbox13 J_dropdown_menu">
	                        <div class="dropdow_inner13">
	                            <ul class="nav_box">
	                                <li><a class="J_listitme" href="{:P(array('new'=>''))}">全部</a></li>
	                                <li><a class="J_listitme" href="{:P(array('new'=>1))}">未查看</a></li>
	                                <li><a class="J_listitme" href="{:P(array('new'=>2))}">已查看</a></li>
	                            </ul>
	                        </div>
	                    </div>
	                </div>
				</div>
				<div class="th4">操作</div>
			</div>
			<notempty name="msg['list']">
				<form id="J_favoritesForm" class="J_allListBox" method="post">
					<volist name="msg['list']" id="m">
						<div class="pms J_hoverbut" pmid="{$m.pmid}">
							<div class="td1"><input class="J_allList" name="id[]" type="checkbox" value="{$m.pmid}" /></div>
							<div class="td2 link_blue substring nowrap">
								{$m.message|default="&nbsp;&nbsp;"}
							</div>
							<div class="td3">{:date('Y-m-d H:i',$m['dateline'])}</div>
							<if condition="$m['new'] eq 2">
								<div class="td4 ok">已查看</div>
							<else/>
								<div class="td4">未查看</div>
							</if>
							<div class="td5 link_blue">
								<a href="javascript:;" class="J_msg_check">查看</a>&nbsp;&nbsp;
								<a href="javascript:;" url="{:U('personal/msg_del',array('id'=>$m['pmid']))}" class="delete">删除</a>
							</div>
						</div>
					</volist>
				</form>
				<div class="pms_btn">
		            <div class="td1"><input name="" class="J_allSelected" type="checkbox" value=""></div>
		            <div class="td2">
		                <div class="but_blue_80_32 J_hoverbut J_set_interview">设为已读</div>
		            </div>
		            <div class="td3">
		                <div class="but_gray_80_32 J_hoverbut J_delall">删除</div>
		            </div>
		            <div class="clear"></div>
		        </div>
		        <div class="qspage">{$msg.page}</div>
			<else />
				<div class="res_empty">
	                您暂时还没有消息记录
	            </div>
			</notempty>
  		</div>
		<div class="clear"></div>
	</div>
	<include file="index_footer" />
	<script type="text/javascript" src="../public/js/jquery.allselected.js"></script>
	<script type="text/javascript">
		$('.J_msg_check').click(function(){
			var f = $(this).closest('.pms'),
				id = f.attr('pmid');
			var qsDialog = $(this).dialog({
        		title: '消息详情',
				loading: true,
				btns: ['删除', '返回'],
				showFooter: false,
				yes: function() {
					$.post("{:U('Personal/msg_del')}",{id:id},function(result){
						if(result.status == 1){
							f.remove();
							disapperTooltip('success',result.msg);
						}else{
							disapperTooltip('remind',result.msg);
						}
					},'json');
				}
			});
			$.getJSON("{:U('Personal/msg_check')}",{id:id},function(result){
	    		if(result.status == 1){
	    			f.find('.td4').addClass('ok').html('已查看');
	    			qsDialog.setContent(result.data);
        			qsDialog.showFooter(true);
	    		}else{
	    			qsDialog.setContent('<div class="confirm">' + result.msg + '</div>');
	    		}
	    	});
		});
		$(".delete").click(function () {
            var url = $(this).attr('url'),
            	f = $(this).closest('.pms'),
				id = f.attr('pmid');
            var qsDialog = $(this).dialog({
                title: '删除消息',
                loading: true,
                border: false,
                yes: function () {
                    $.post("{:U('Personal/msg_del')}",{id:id},function(result){
						if(result.status == 1){
							f.remove();
							disapperTooltip('success',result.msg);
						}else{
							disapperTooltip('remind',result.msg);
						}
					},'json');
                }
            });
            $.getJSON(url, function (result) {
                if (result.status == 1) {
                    qsDialog.setContent(result.data.html);
                } else {
                    disapperTooltip('remind', result.msg);
                }
            });
        });
        $('.J_set_interview').click(function(){
        	var listCheckedArray = $('.J_allListBox .J_allList:checked');
            if (listCheckedArray.length) {
                $.post("{:U('Personal/msg_check')}",$("#J_favoritesForm").serialize(),function (result) {
                    if (result.status == 1) {
                    	listCheckedArray.closest('.pms').find('.td4').addClass('ok').html('已查看');
                        disapperTooltip('success','系统信息查看成功！');
                    } else {
                        disapperTooltip('remind', result.msg);
                    }
                },'json');
            } else {
                disapperTooltip("remind", "请选择要查看的系统消息");
            }
        });
        $('.J_delall').click(function(){
        	var listCheckedArray = $('.J_allListBox .J_allList:checked');
            if (listCheckedArray.length) {
            	var qsDialog = $(this).dialog({
	                title: '删除消息',
	                loading: true,
	                border: false,
	                yes: function () {
	                    $.post("{:U('Personal/msg_del')}",$("#J_favoritesForm").serialize(),function (result) {
		                    if (result.status == 1) {
		                    	listCheckedArray.closest('.pms').remove();
		                        disapperTooltip('success',result.msg);
		                    } else {
		                        disapperTooltip('remind', result.msg);
		                    }
		                },'json');
	                }
	            });
	            $.getJSON("{:U('Personal/msg_del')}", function (result) {
	                if (result.status == 1) {
	                    qsDialog.setContent(result.data.html);
	                } else {
	                    disapperTooltip('remind', result.msg);
	                }
	            });
            } else {
                disapperTooltip("remind", "请选择要删除的系统消息");
            }
        });
	</script>
</body>
</html>